/**********************************************************************
* File: ifEngin.h
* ID  : 
* Purpose: Delcare the prototype for class ifEngine.
* Date   : 2004/04/16
* Author : T.S.Yo
* Description:
**********************************************************************/

#ifndef IFENGINE_H
#define IFENGINE_H

#include <iostream>
#include <string>
#include "item.cpp"
#include "map.cpp"
#include "character.cpp"

using namespace std;

class ifEngine
{
    public:
    // Constructor and Destructor
        ifEngine();
        ~ifEngine();
    
    // Load Game
        void loadMap(const char *mapFileName);
        void loadItem(const char *itemFileName);

    // Command function
        void print_help();                             // Print out valid command
        void command(string &cmd);                     // Get a line of command
        void processCommand(const string &cmdLine);    // Processing command
        
        void move(const char &direction);              // Move to given direction
        void look();                                   // Get information of current location
        void takeItem(const string &itemName);         // Take certain item
        void dropItem(const string &itemName);         // Drop certain item
        void examItem(const string &itemName);         // Exam certain item

        void inventory();                              // Show inventory
        void score();                                  // Show score
        
    // Start, maintain and end of the engine
        void start();                                  // Start IF-Engine
        void end();                                    // End IF-Engine
        void checkEvent(bool (&eventFlag)[10]);
        void checkEnd(string &cmd);


  private:
    Map map1;
    Character player;
    bool eventFlag[10];
//    BSTree<Item,string> items;
};

#endif    //#ifndef IFENGINE_H



